$(function () {
    let name = window.localStorage.getItem("name")
    $.ajax({
        type: 'post',
        url: '/fr/fr/sc/' + name + '',
        success: function (res) {
            console.log(res.data);
            let list = eval(res.data)
            let str = ""
            $.each(list, function (idx, item) {
                console.log(idx);
                str += "<div class=\"pp\" id=\"likeee\">\n" +
                    "  <div class=\" first_restaurant\" style=\"height: 220px;background-color: white;margin-left: 30px\" id=\"idx\" >" +
                    "                            <div class=\"first_restaurant_left\">\n" +
                    "<a href='/fr/storeInfo/enter/" + item.id + "'>" +
                    "                                <img  src=\"/fr" + item.shop_picture + "\" style=\" width: 272px; height: 212px;\"alt=\"\">\n" +
                    "</a>" +
                    "                            </div>\n" +
                    "                            <div class=\"messagexx_right\">\n" +
                    "                                <div class=\"topx\">\n" +
                    "                                    <ul><li><a href=\"#\" id=\"sName\">" + item.shop_name + "</a></li></ul>\n" +
                    "                                    <p class=\"pf\">评分:" + item.shop_score + "</p>\n" +
                    "                                    <span class=\"_1p0FLy4t\">店铺电话:" + item.shop_telnumber + "</span>\n" +
                    "                                    <div style=\"width: 100%;height: 1px;background-color: #e0e0e0; margin: auto; margin-top: 5px;\"></div>\n" +
                    "                                </div>\n" +
                    "                                <div class=\"downx\">\n" +
                    "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\">营业时间" + item.business_time + "</p>\n" +
                    "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\"> 人均消费" + item.consumption + "</p>\n" +
                    "                                </div>\n" +
                    "                            </div>\n" +
                    "                        </div>" +
                    "                                        </div>";
                $(".down-message").html(str);
                // window.location.href='http://localhost:8081/fr/fr/search/%E5%90%8C/1'
            })
        }


    })
});
$(function () {
    let name = window.localStorage.getItem("indexName")
    $.ajax({
        type: 'post',
        url: '/fr/fr/sc/' + name + '',
        success: function (res) {
            console.log(res.data);
            let list = eval(res.data)
            let str = ""
            $.each(list, function (idx, item) {
                console.log(idx);
                str += "<div class=\"pp\" id=\"likeee\">\n" +
                    "  <div class=\" first_restaurant\" style=\"height: 220px;background-color: white;margin-left: 30px\" id=\"idx\" >" +
                    "                            <div class=\"first_restaurant_left\">\n" +
                    "<a href='/fr/storeInfo/enter/" + item.id + "'>" +
                    "                                <img  src=\"/fr" + item.shop_picture + "\" style=\" width: 272px; height: 212px;\"alt=\"\">\n" +
                    "</a>" +
                    "                            </div>\n" +
                    "                            <div class=\"messagexx_right\">\n" +
                    "                                <div class=\"topx\">\n" +
                    "                                    <ul><li><a href=\"#\" id=\"sName\">" + item.shop_name + "</a></li></ul>\n" +
                    "                                    <p class=\"pf\">评分:" + item.shop_score + "</p>\n" +
                    "                                    <span class=\"_1p0FLy4t\">店铺电话:" + item.shop_telnumber + "</span>\n" +
                    "                                    <div style=\"width: 100%;height: 1px;background-color: #e0e0e0; margin: auto; margin-top: 5px;\"></div>\n" +
                    "                                </div>\n" +
                    "                                <div class=\"downx\">\n" +
                    "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\">营业时间" + item.business_time + "</p>\n" +
                    "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\"> 人均消费" + item.consumption + "</p>\n" +
                    "                                </div>\n" +
                    "                            </div>\n" +
                    "                        </div>" +
                    "                                        </div>";
                $(".down-message").html(str);
                // window.location.href='http://localhost:8081/fr/fr/search/%E5%90%8C/1'
            })
        }


    })
});
$(function() {
    $("#sea11").bind("keypress",function (event) {
        if (event.keyCode == "13") {
            let str10 = document.getElementById("sea11").value;
            $.ajax({
                type: 'post',
                url: '/fr/fr/sc/' + str10 + '',
                success: function (res) {
                    console.log(res.data);
                    let list = eval(res.data)
                    let str = ""
                    $.each(list, function (idx, item) {
                        console.log(idx);
                        str += "<div class=\"pp\" id=\"likeee\">\n" +
                            "  <div class=\" first_restaurant\" style=\"height: 220px;background-color: white;margin-left: 30px\" id=\"idx\" >" +
                            "                            <div class=\"first_restaurant_left\">\n" +
                            "<a href='/fr/storeInfo/enter/" + item.id + "'>" +
                            "                                <img  src=\"/fr" + item.shop_picture + "\" style=\" width: 272px; height: 212px;\"alt=\"\">\n" +
                            "</a>" +
                            "                            </div>\n" +
                            "                            <div class=\"messagexx_right\">\n" +
                            "                                <div class=\"topx\">\n" +
                            "                                    <ul><li><a href=\"#\" id=\"sName\">" + item.shop_name + "</a></li></ul>\n" +
                            "                                    <p class=\"pf\">评分:" + item.shop_score + "</p>\n" +
                            "                                    <span class=\"_1p0FLy4t\">店铺电话:" + item.shop_telnumber + "</span>\n" +
                            "                                    <div style=\"width: 100%;height: 1px;background-color: #e0e0e0; margin: auto; margin-top: 5px;\"></div>\n" +
                            "                                </div>\n" +
                            "                                <div class=\"downx\">\n" +
                            "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\">营业时间" + item.business_time + "</p>\n" +
                            "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\"> 人均消费" + item.consumption + "</p>\n" +
                            "                                </div>\n" +
                            "                            </div>\n" +
                            "                        </div>" +
                            "                                        </div>";
                        $(".down-message").html(str);
                        // window.location.href='http://localhost:8081/fr/fr/search/%E5%90%8C/1'
                    })
                }


            })
        }
    })
});
//
// function shop(shopName) {
//     window.location.href = 'http://localhost:8081/fr/fr/search/enter/'+shopName+'/1'
// }

